home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / MATHS / ARCAUT / Automatons / Tron < prev    next >
Text File  |  1991-07-27  |  1KB  |  42 lines

  1. AUTOMATON*
  2.  
  3.   Tron
  4.  
  5.   A two state automaton using the Margolus neighbourhood. As with 'Critter',
  6.   most cells reverse their state at each generation, producing a flashing
  7.   display; careful choice of colours prevents this from being too garish. Try
  8.   200x100 & 100x50 windows. Tron is a reversible self inverse automaton -
  9.   altering phase at any stage, then resuming, causes the automaton to undo
  10.   it's previous behaviour.
  11.  
  12. INITIALISATION*
  13.  
  14.   10DEF PROCdo
  15.   20*SetEval wrap on
  16.   30*SetEval neig margolus
  17.   40*SetEval i 64
  18.   50*SetEval b 10
  19.   60ENDPROC
  20.  
  21. SCREEN*
  22.  
  23.   10DEF PROCdo 
  24.   20DIM buf% 256:SYS "OS_ReadVarVal","sux",buf%,256:sux%=4*!buf%
  25.   30SYS "OS_ReadVarVal","suy",buf%,256:suy%=4*!buf%
  26.   40SYS "OS_ReadVarVal","i",buf%,256
  27.   50c%=FNacol(!buf%):GCOL c%AND63 TINT c%
  28.   60SYS "OS_ReadVarVal","b",buf%,256
  29.   70c%=FNacol(!buf%):GCOL 128+(c%AND63) TINT c%:CLG
  30.   80FOR Q%=1 TO RND(2)
  31.   90RECTANGLE RND(sux%)-sux%/2,RND(suy%)-suy%/2,RND(sux%),RND(suy%)
  32.  100NEXT
  33.  110ENDPROC
  34.  
  35. CODE*
  36.  
  37. ( READ_NEIG
  38.   <i> SCOUNT_ALL DUP 0 = IF (<i>  ==)
  39.                      4 = IF (<b>  ==)
  40.                              CELL ==  )
  41.  
  42. END*